package com.innovation.chengzhangriji.ui.widget;

import android.view.View;
import android.widget.LinearLayout;

import com.innovation.chengzhangriji.R;

public class PublicMilestoneValueAdapterViewHolder extends BasePublicMilestoneAdapterViewHolder {

    private LinearLayout mLayout;

    private CuteTextView mTextMilestone;

    private CuteTextView mTextMilestoneExtra;

    public PublicMilestoneValueAdapterViewHolder(View itemView) {
        super(itemView);
        mLayout = (LinearLayout) itemView.findViewById(R.id.layout);
        mTextMilestone = (CuteTextView) itemView.findViewById(R.id.milestone);
        mTextMilestoneExtra = (CuteTextView) itemView.findViewById(R.id.milestone_extra);
    }

    public void select(boolean select) {
        if (select) {
            mLayout.setBackgroundResource(R.drawable.bg_milestone_item);
        } else {
            mLayout.setBackgroundDrawable(null);
        }
    }

    public void setMilestone(String milestone) {
        mTextMilestone.setText(milestone);
    }

    public void setMilestoneExtra(String extra) {
        mTextMilestoneExtra.setText(extra);
    }

    public void showExtra(boolean show) {
        if (show) {
            mTextMilestoneExtra.setVisibility(View.VISIBLE);
        } else {
            mTextMilestoneExtra.setVisibility(View.GONE);
        }
    }

}
